The investigation below suggests that the found polynomial families are appell sequences <=> are have translation properties <=> have interesting derivative properties
Q: are $p_m(n, k)$ linearly independent? Sol: show $p_m(0, k) = k^m$. Then this uses the fact the $x^m$ are linearly independent polynomials. Simple using the recurrence definition.
Q: given a polynomial $p$ that is BH, is it a linear comb. of $\{p_m\}$? Given any polynomial in (n,k), is it a linear combination of $\{p_m\}$? Scratch: the bernoulli polynomials have an inversion formula, take a look at that.
from sympy import *
x = symbols('x')
k = symbols('k')
a = symbols('a')
n = symbols('n')
import functools
def bh(m):
if m < 0:
return lambda n, k: 0
if m == 0:
return lambda n, k: 1
elif m == 1:
return lambda n, k: k
else:
def alternating_tangent(n):
# https://mathworld.wolfram.com/TangentNumber.html
return 2 ** (2*n) * (2**(2*n)-1) * Abs(bernoulli(2*n)) / (2*n)
def R(n, k):
running_sum = 0
for j in range(1, round(m/2) + 1):
i = m - 2*j
running_sum += (-1)**(j) * alternating_tangent(j) * binomial(m-1, (2 * j - 1)) * bh(i)(n, k)
return running_sum
def fm(n, k):
return k * bh(m-1)(n,k) + n * R(n, k)
return fm
bh_ = lambda m: (lambda x: bh(m)(n, x)) # fixing n
def f(m):
def fm(n, k):
return (k + n) ** (m)
return fm
f_ = lambda m: (lambda x: f(m)(n, x)) # fixing n
for s in [f_, bh_]:
assert expand(s(2)(x-2)) == expand(s(2)(x) - 2 * s(1)(x) * 2 + s(0)(x) * 4)
assert expand(s(3)(x+1)) == expand(s(3)(x) + 3 * s(2)(x) + 3 * s(1)(x) + s(0)(x))
# satifies appell seq.
assert expand(diff(bh_(3)(x), x)) == expand(3 * bh_(2)(x))
assert expand(diff(bh_(4)(x), x)) == expand(4 * bh_(3)(x))
assert expand(diff(bh_(5)(x), x)) == expand(5 * bh_(4)(x))
collect( (expand(bh(4)(1, k+1) + bh(4)(1, k-1)))/2, n)
expand(f(3)(1, k + 1) + f(3)(1, k - 1))
expand(2 *binomial(3,0)*bh(3)(n, k) + 2 *binomial(3,1)*bh(1)(n, k))
expand(bh(4)(0, k))
expand(bh(4)(n+1, k+1) + bh(3)(n+1, k+1) + bh(4)(n+1, k-1) + bh(3)(n+1, k-1) )
expand(2 * bh(4)(n, k) + 2*bh(3)(n, k))
expand(bh(4)(n+1, k+1) + bh(3)(n+1, k+1))
expand(bh(4)(n+1, k-1) + bh(3)(n+1, k-1))
expand(bh(4)(n, k) )
expand(bh(6)(n, k))
for m in range(7):
print(m, expand(bh(m)(n, k)))
0 1 1 k 2 k**2 - n 3 k**3 - 3*k*n 4 k**4 - 6*k**2*n + 3*n**2 + 2*n 5 k**5 - 10*k**3*n + 15*k*n**2 + 10*k*n 6 k**6 - 15*k**4*n + 45*k**2*n**2 + 30*k**2*n - 15*n**3 - 30*n**2 - 16*n
expand(bh(6)(n, k))